function getParams() {

    //获取问号及问号后面的内容

    var url = window.location.search;

    var params = new Object();

    if (url.indexOf("?") != -1) {

        //截取问号后面的内容,再使用&分割多个属性

        var arr = url.substr(1).split("&");

        for (var i = 0; i < arr.length; i++) {

            //使用=分割为keyvalue

            var keyValue = arr[i].split("=");

            params[keyValue[0]] = keyValue[1];

        }

    }

    return params;

}
var vue = new Vue({
    el:"#app",
    data:{
        spots:{}
    },
    methods:{
    },
    mounted:function () {
        //景点列表
            var _this = this;
        var params = getParams();
        var id = params.id;
            $.get("http://localhost:8008/spot/get", {id:id}, function (data) {
                _this.spots = data.data;

            })

    }
});

